package com.bangdream.michelia.view.adapter;


import android.text.Html;
import android.view.View;
import android.widget.ImageView;

import com.bangdream.michelia.R;
import com.bangdream.michelia.entity.CollectionBean;
import com.bangdream.michelia.entity.TeacherBean;
import com.bangdream.michelia.entity.courses.CoursesBean;
import com.bangdream.michelia.utils.ImageLoadUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * Created by zhouyi on 2018/3/25.
 */

public class CollectionAdapter extends BaseQuickAdapter<CollectionBean,BaseViewHolder> {
    public CollectionAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, CollectionBean item) {

        ImageView ivIcon = helper.getView(R.id.ivIcon);

        CoursesBean course = item.getCourse();

        if(course!=null){
            ImageLoadUtils.ImageLoad(mContext,course.getFaceUrl(),ivIcon,-1);
            helper.setText(R.id.tvTitle,course.getName());
            helper.setText(R.id.tvContent,course.getIntroduction());
        }
    }
}
